//
//  BaseNavigationController.swift
//  ShangYouNews
//
//  Created by wangkun on 2017/5/10.
//  Copyright © 2017年 baymax. All rights reserved.
//

import UIKit

open class BaseNavigationController: UINavigationController {
    
    override open var shouldAutorotate: Bool {
        guard let vc = self.childViewControllers.last else {
            return true
        }
        return vc.shouldAutorotate
    }
    
    override open var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        guard let vc = self.childViewControllers.last else {
            return .portrait
        }
        return vc.supportedInterfaceOrientations
    }
    
    override open var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
        guard let vc = self.childViewControllers.last else {
            return .portrait
        }
        return vc.preferredInterfaceOrientationForPresentation
    }
    
}

